package com.trkj.base;

import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.widget.Toast;

/**
 * Created by LiZanhong on 2015/06/15.
 */
public abstract class BaseFragment extends Fragment{

    /**
     * 获得屏幕大小
     * @return
     */
    protected Size getScreenSize(){
        DisplayMetrics dm = new DisplayMetrics();
        this.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
        int screenWidth = dm.widthPixels;
        int screenHeight = dm.heightPixels;

        return new Size(screenWidth, screenHeight);
    }

    protected int getColor(int colorId){
        return Constants.Color.getColor(
                this.getActivity(),
                colorId);
    }

    protected void toast(String content){
        Toast.makeText(this.getActivity(), content, Toast.LENGTH_SHORT).show();
    }


}
